/*
 * $Id: OhMy.java 69 2013-01-07 17:43:36Z vladimirow@mail.ru $
 * $HeadURL: https://ultralog.googlecode.com/svn/ultralog/trunk/src-example/java/com/google/code/ultralog/example/OhMy.java $
 *
 * This file is a part of ultralog project (http://code.google.com/p/ultralog/).
 * Released under New BSD License.
 */

import com.google.code.ultralog.BasicLogger;
import com.google.code.ultralog.LoggerManager;

/**
 * Example that shows how exception could be logged along with error message.
 *
 * @author Mikhail Vladimirov
 */
public class OhMy
{
    /**
     * Entry point of the example.
     *
     * @param args command-line arguments
     */
    public static void main (String [] args)
    {
        BasicLogger logger = LoggerManager.createLogger (BasicLogger.class);

        try
        {
            @SuppressWarnings ("unused")
            int x = 100 / 0;
        }
        catch (Throwable ex)
        {
            if (logger.isErrorEnabled ())
                logger.error ("Oh My!", ex);
        }
    }
}
